﻿
var user = document.getElementById('usernumber'),
    pass = document.getElementById('password'),
    check = document.getElementById('remember'),
    localUser = localStorage.getItem('user') || ''; //获取到user的值并保存
localPass = localStorage.getItem('pass') || ''; //获取到pwd的值并保存
user.value = localUser;
pass.value = localPass;
if (localUser !== '' && localPass !== '') {
    check.setAttribute('checked', '');
}
function fn() {
    if (check.checked) {
        localStorage.setItem('user', user.value);
        localStorage.setItem('pass', pass.value);
    } else {
        localStorage.setItem('user', '');
        localStorage.setItem('pass', '');
    }
}